import request from "@/request/";

// 获取列表
export const getList = (data) => {
  return request({
    url: "/api/mes-equipment-service/device-ledger/page",
    method: "POST",
    data,
  });
};

// 获取详情
export const getDetail = (id) => {
  return request({
    url: "/api/mes-equipment-service/device-ledger/detail",
    method: "POST",
    data: {
      id,
    },
  });
};

// 导出
export const exportTableData = (data) => {
  return request({
    url: `/api/mes-equipment-service/device-ledger/export`,
    method: "POST",
    responseType: "blob",
    timeout: 300000,
    data: data,
  });
};

// 新增
export const add = (data) => {
  return request({
    url: "/api/mes-equipment-service/device-ledger/save",
    method: "POST",
    data,
  });
};

// 删除
export const remove = (data) => {
  return request({
    url: "/api/mes-equipment-service/device-ledger/delete",
    method: "POST",
    data,
  });
};

// 更新
export const update = (data) => {
  return request({
    url: "/api/mes-equipment-service/device-ledger/update",
    method: "POST",
    data,
  });
};

// 更改状态
export const updateStatus = (data) => {
  return request({
    url: "/api/mes-equipment-service/device-ledger/state/update",
    method: "POST",
    data,
  });
};

// 获取设备名称下拉列表
export const getDeviceNameList = () => {
  return request({
    url: "/api/mes-production-service/work-station/add/device-name-list",
    method: "GET",
  });
};
// 获取线体名称下拉列表
export const getLineNameList = () => {
  return request({
    url: "/api/mes-production-service/work-station/add/line-name-list",
    method: "GET",
  });
};
// 获取工序名称下拉列表
export const getProcessNameList = () => {
  return request({
    url: "/api/mes-production-service/work-station/add/process-name-list",
    method: "GET",
  });
};
